#pragma once

#include "Game/Process/RenderProcess.h"
#include "Render/Texture/Picture2DTexture.h"
#include "Render/Texture/RenderTarget.h"
#include "Render/Tradition/RHIRenderPass.h"
#include "Render/Tradition/GraphicsPipeline.h"
#include "Render/Texture/ColorRenderTarget.h"
#include "Render/Texture/CubemapTexture.h"
#include "Render/Texture/DepthRenderTarget.h"
#include "Render/Shader/RHIDescriptor.h"
#include "Render/Tradition/RHIFramebuffer.h"

class LocalScene;
class ResourceProcess;
class ShadowsAtrousFilterProcess;
class ReflectionsAtrousFilterProcess;

class DeferredProcess : public RenderProcess
{
	DECLARE_PROCESS(DeferredProcess)

	struct PushConstants
	{
		int32 shadow;
		int32 ao;
		int32 gi;
		int32 reflections;
	};

public:

	bool mShadow;
	bool mAo;
	bool mGi;
	bool mReflections;

	PushConstants mPushConstants;

protected:

	virtual void OnInit() override;

	virtual void OnTick(float deltaTime) override;

	virtual void OnResize() override;

protected:

	LocalScene* mLocalScene;

	ResourceProcess* mResourceProcess;

	ShadowsAtrousFilterProcess* mShadowsAtrousFilterProcess;

	ReflectionsAtrousFilterProcess* mReflectionsAtrousFilterProcess;




	




	std::array<DescriptorMask, 2> mGBufferDescriptorMask;

	std::array<DescriptorMask, 2> mShadowDescriptorMask;

	DescriptorMask mAoDescriptorMask;

	DescriptorMask mGiDescriptorMask;

	std::array<DescriptorMask, 2> mReflectionsDescriptorMask;

	DescriptorMask mCommonDescriptorMask;




	RefCountPtr<RHIDescriptor> mDescriptor;

	RefCountPtr<ColorRenderTarget> mDeferredImage;

	RefCountPtr<GraphicsPipeline> mPipeline;

	RefCountPtr<RHIRenderPass> mRenderPass;

	RefCountPtr<RHIFrameBuffer> mFrameBuffer;



};
